﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_NhanDuLieu : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvTKCoDoanhThu")]
        private ADVAccount _AdvTKCoDoanhThu;
        [AccessedThroughProperty("AdvTKNo")]
        private ADVAccount _AdvTKNo;
        [AccessedThroughProperty("AdvTKThue")]
        private ADVAccount _AdvTKThue;
        [AccessedThroughProperty("CboChiNhanh")]
        private ComboBox _CboChiNhanh;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;

        public Frm_NhanDuLieu()
        {
            base.Load += new EventHandler(this.Frm_NhanDuLieu_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mAllowView = false;
            this.mAllowDel = false;
            this.mAllowEdit = false;
            this.InitializeComponent();
        }

        public void BuildComboClient()
        {
            DataTable table = new clsDMDoiTuong().ShowListByField("Khoa|Ma|Ten" + modGeneral.H_LANGUAGE + " As Ten ", " CharIndex('U',Loai) <> 0", "");
            this.CboChiNhanh.DataSource = table;
            this.CboChiNhanh.DisplayMember = "Ten";
            this.CboChiNhanh.ValueMember = "Khoa";
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            if (this.AdvTKNo.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn t\x00e0i khoản thanh to\x00e1n", ""));
                this.AdvTKNo.Focus();
            }
            else if (this.AdvTKCoDoanhThu.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn t\x00e0i khoản doanh thu", ""));
                this.AdvTKCoDoanhThu.Focus();
            }
            else if (this.AdvTKThue.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn t\x00e0i khoản thuế", ""));
                this.AdvTKThue.Focus();
            }
            else if (this.GetDataFromClient())
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Nghiệp vụ thực hiện th\x00e0nh c\x00f4ng", ""));
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_NhanDuLieu_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.BuildComboClient();
                this.AdvTKNo.SetDefault();
                this.AdvTKCoDoanhThu.SetDefault();
                this.AdvTKThue.SetDefault();
            }
        }

        public bool GetDataFromClient()
        {
            bool flag=false;
            this.Cursor = Cursors.WaitCursor;
            IDataParameter[] commandParameters = new IDataParameter[9];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, LVYModule.Date2Char(this.TxtTuNgay.Text));
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, LVYModule.Date2Char(this.TxtDenNgay.Text));
                commandParameters[2] = DBHelper.createParameter("@KhoaDoiTuong", DbType.Int64, ParameterDirection.Input, RuntimeHelpers.GetObjectValue(this.CboChiNhanh.SelectedValue));
                commandParameters[3] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, modGeneral.H_CLIENT);
                commandParameters[4] = DBHelper.createParameter("@KhoaTKThanhToan", DbType.Int64, ParameterDirection.Input, this.AdvTKNo.Value);
                commandParameters[5] = DBHelper.createParameter("@KhoaTKDoanhThu", DbType.Int64, ParameterDirection.Input, this.AdvTKCoDoanhThu.Value);
                commandParameters[6] = DBHelper.createParameter("@KhoaTKThue", DbType.Int64, ParameterDirection.Input, this.AdvTKThue.Value);
                commandParameters[7] = DBHelper.createParameter("@pAmKho", DbType.Double, ParameterDirection.Output, 0);
                commandParameters[8] = DBHelper.createParameter("@pError", DbType.Double, ParameterDirection.Output, 0);
                DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "HT_GetDataFromClient", commandParameters);
                this.Cursor = Cursors.Default;
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(commandParameters[8].Value, 0, false))
                {
                    return true;
                }
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(commandParameters[7].Value, 0, false))
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Nghiệp vụ kh\x00f4ng thực hiện được v\x00ec kho bị \x00e2m", ""));
                }
                flag = false;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                this.Cursor = Cursors.Default;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.GroupBox1 = new GroupBox();
            this.AdvTKThue = new ADVAccount();
            this.Label5 = new Label();
            this.AdvTKCoDoanhThu = new ADVAccount();
            this.Label4 = new Label();
            this.AdvTKNo = new ADVAccount();
            this.Label3 = new Label();
            this.Label2 = new Label();
            this.TxtDenNgay = new DateTimePicker();
            this.Label13 = new Label();
            this.TxtTuNgay = new DateTimePicker();
            this.Label1 = new Label();
            this.CboChiNhanh = new ComboBox();
            this.GroupBox1.SuspendLayout();
            this.SuspendLayout();
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            Point point = new Point(0x14b, 0x9b);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            Size size = new Size(0x49, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 8;
            this.CmdCancel.Text = "Th&o\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = ACCOUNTING.My.Resources.Resources.Selected;
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0xf9, 0x9b);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x4d, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 7;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.GroupBox1.BackColor = Color.Transparent;
            this.GroupBox1.Controls.Add(this.AdvTKThue);
            this.GroupBox1.Controls.Add(this.Label5);
            this.GroupBox1.Controls.Add(this.AdvTKCoDoanhThu);
            this.GroupBox1.Controls.Add(this.Label4);
            this.GroupBox1.Controls.Add(this.AdvTKNo);
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.TxtDenNgay);
            this.GroupBox1.Controls.Add(this.Label13);
            this.GroupBox1.Controls.Add(this.TxtTuNgay);
            this.GroupBox1.Controls.Add(this.Label1);
            this.GroupBox1.Controls.Add(this.CboChiNhanh);
            point = new Point(4, 3);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(400, 0x92);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 9;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00f9y chọn";
            this.AdvTKThue.Conditions = "";
            this.AdvTKThue.DefaultValue = "33311";
            this.AdvTKThue.FieldNameFilter = "";
            this.AdvTKThue.KeyFilter = "";
            point = new Point(0x69, 0x75);
            this.AdvTKThue.Location = point;
            Padding padding = new Padding(0);
            this.AdvTKThue.Margin = padding;
            this.AdvTKThue.Name = "AdvTKThue";
            this.AdvTKThue.OnlyDigit = false;
            this.AdvTKThue.ReadOnly = false;
            size = new Size(0x112, 20);
            this.AdvTKThue.Size = size;
            this.AdvTKThue.TabIndex = 0x1b;
            this.AdvTKThue.UpperText = true;
            this.AdvTKThue.Value = "";
            this.AdvTKThue.WithCode = 80;
            this.Label5.AutoSize = true;
            point = new Point(13, 0x77);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x34, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x1a;
            this.Label5.Text = "TK. Thuế";
            this.AdvTKCoDoanhThu.Conditions = "";
            this.AdvTKCoDoanhThu.DefaultValue = "5112";
            this.AdvTKCoDoanhThu.FieldNameFilter = "";
            this.AdvTKCoDoanhThu.KeyFilter = "";
            point = new Point(0x69, 0x5c);
            this.AdvTKCoDoanhThu.Location = point;
            padding = new Padding(0);
            this.AdvTKCoDoanhThu.Margin = padding;
            this.AdvTKCoDoanhThu.Name = "AdvTKCoDoanhThu";
            this.AdvTKCoDoanhThu.OnlyDigit = false;
            this.AdvTKCoDoanhThu.ReadOnly = false;
            size = new Size(0x112, 20);
            this.AdvTKCoDoanhThu.Size = size;
            this.AdvTKCoDoanhThu.TabIndex = 0x19;
            this.AdvTKCoDoanhThu.UpperText = true;
            this.AdvTKCoDoanhThu.Value = "";
            this.AdvTKCoDoanhThu.WithCode = 80;
            this.Label4.AutoSize = true;
            point = new Point(13, 0x5e);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x4d, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x18;
            this.Label4.Text = "TK. Doanh thu";
            this.AdvTKNo.Conditions = "";
            this.AdvTKNo.DefaultValue = "1361";
            this.AdvTKNo.FieldNameFilter = "";
            this.AdvTKNo.KeyFilter = "";
            point = new Point(0x69, 0x43);
            this.AdvTKNo.Location = point;
            padding = new Padding(0);
            this.AdvTKNo.Margin = padding;
            this.AdvTKNo.Name = "AdvTKNo";
            this.AdvTKNo.OnlyDigit = false;
            this.AdvTKNo.ReadOnly = false;
            size = new Size(0x112, 20);
            this.AdvTKNo.Size = size;
            this.AdvTKNo.TabIndex = 0x17;
            this.AdvTKNo.UpperText = true;
            this.AdvTKNo.Value = "";
            this.AdvTKNo.WithCode = 80;
            this.Label3.AutoSize = true;
            point = new Point(13, 0x45);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x52, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x16;
            this.Label3.Text = "TK. Thanh to\x00e1n";
            this.Label2.AutoSize = true;
            point = new Point(0xcd, 0x2e);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x35, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x13;
            this.Label2.Text = "Đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x120, 0x2a);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x5b, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 20;
            this.Label13.AutoSize = true;
            point = new Point(13, 0x2e);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x11;
            this.Label13.Text = "Từ ng\x00e0y";
            this.TxtTuNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x69, 0x2a);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x5b, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x12;
            this.Label1.AutoSize = true;
            point = new Point(13, 0x15);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x37, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x10;
            this.Label1.Text = "Chi nh\x00e1nh";
            this.CboChiNhanh.FormattingEnabled = true;
            point = new Point(0x69, 0x11);
            this.CboChiNhanh.Location = point;
            this.CboChiNhanh.Name = "CboChiNhanh";
            size = new Size(0x112, 0x15);
            this.CboChiNhanh.Size = size;
            this.CboChiNhanh.TabIndex = 15;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x19d, 0xbc);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdOK);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_NhanDuLieu";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0013";
            this.Text = "NHAN DU LIEU";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.ResumeLayout(false);
        }

        internal virtual ADVAccount AdvTKCoDoanhThu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKCoDoanhThu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKCoDoanhThu = value;
            }
        }

        internal virtual ADVAccount AdvTKNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKNo = value;
            }
        }

        internal virtual ADVAccount AdvTKThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKThue = value;
            }
        }

        internal virtual ComboBox CboChiNhanh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboChiNhanh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboChiNhanh = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTuNgay = value;
            }
        }
    }
}

